package constant

// define message versions
const (
	HslMsgVersion1 = "1.0.0"
)

//p2p消息类型
const (
	MsgGetBlock = iota + 1
	MsgBroadcastTransaction
	MsgBroadcastBlock
	MsgHandShake
	MsgPeerInfo
	MsgConsensus
	MsgConsensusSync
	MsgFailed
)

const (
	//BroadcastBlockAddress p2p消息地址
	BroadcastBlockAddress = "/broadcast/block/0.0.1"
	//BroadcastTransactionAddress 交易广播地址
	BroadcastTransactionAddress = "/broadcast/transaction/0.0.1"
	//HandShakeAddress  握手地址
	HandShakeAddress = "/init/handShake/0.0.1"
	//Consensus 共识消息地址
	Consensus = "/consensus/message/0.0.1"
	//ConsensusSync 共识同步消息
	ConsensusSync = "/consensusSync/message/0.0.1"
	//DownloadBlockAddress 下载区块地址
	DownloadBlockAddress = "/download/block/0.0.1"
	//PeerInfoAddress PeerInfo地址
	PeerInfoAddress = "/peer/peerinfo/0.0.1"
	// BroadCstTxBufSize 接受以及一次性转发交易最大缓存数
	BroadCstTxBufSize = 1024
	// TxPoolBufSize 交易缓冲池大小
	TxPoolBufSize = 131072
	// TxPreRemovePoolSize TxPreRemovePoolSize
	TxPreRemovePoolSize = 16384
	//BroadCstTxMaxWaitTime 批量广播交易最大等待时间50ms
	BroadCstTxMaxWaitTime = 50
	//BroadCstTxBatchCount 最大批量发送交易数
	BroadCstTxBatchCount = 50
	//TxaddchanSize txaddchan size
	TxaddchanSize = 1024
	//P2pMsgTimeout p2p同步消息超时时间/ms
	P2pMsgTimeout = 5000
)
